package com.sec.android.app.myfiles.module.local.category.audio;

import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.provider.MediaStore;
import android.text.TextUtils;

import com.sec.android.app.myfiles.module.local.category.CategoryListAdapterImp;
import com.sec.android.app.myfiles.navigation.NavigationInfo;
import com.sec.android.app.myfiles.widget.listview.AbsListViewImp;

/**
 * Created by jaebae on 2016-04-29.
 */
public class AudioListAdapterImp extends CategoryListAdapterImp {
    public AudioListAdapterImp(Context context, NavigationInfo navigationInfo, AbsListViewImp listView, Cursor c, int flags) {
        super(context, navigationInfo, listView, c, flags);
        mTableInfo = AudioDbTableInfo.getInstance();
    }

    @Override
    public Uri getUri() {
        return MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
    }

    @Override
    public String getSelection() {
        String ret = super.getSelection();
        //Don't need audio type filter
        if (!TextUtils.isEmpty(ret)) {
            ret = ret.replace(AUDIO_QUERY_WITH_AND, "");
            ret = ret.replace(AUDIO_QUERY, "");
        }
        return ret;
    }
}
